package com.example.rk.mapper;

import com.example.rk.entity.RenKo;
import org.apache.ibatis.annotations.*;
import org.springframework.stereotype.Component;

import java.util.List;

@Mapper
@Component
public interface RenKoMapper {
//    @Select("select * from renko")
//    List<RenKo> findAll();
    @Delete("delete from renko where id=#{id}")
    void deleteById(int id);
    @Insert("insert into renko (diqu,number,data,pm) values(#{diqu},#{number},#{data},#{pm})")
    void create(RenKo renko);
    @Select("SELECT * FROM renko where id=#{id}")
    RenKo findByID(int id);
    @Update("update renko set diqu=#{diqu},pm=#{pm},number=#{number},data=#{data} where id=#{id}")
    void doEdit(RenKo renko);
    @Select("SELECT * FROM renko where data=#{data}")
    RenKo finddata(String data);
    @Select("select * from renko where diqu=#{diqu} and number=${number}")
    RenKo findadd(String diqu, int number);

    List<RenKo> findBySearch(String data, String diqu);

    int count(String code, String name);

    List<RenKo> findBySearchWithPage( String diqu,int number , int pm, String data );
}
